<?php
class Zend_View_Helper_PrintLink extends Zend_View_Helper_Abstract
{
    public $view;

    public function printLink($params = array())
    {
        $req = Zend_Controller_Front::getInstance()->getRequest();
        $url = sprintf('/%s/%s/%s', $req->getParam('module'), 
                $req->getParam('controller'), $req->getParam('action'));
        if (count($params) > 0) {
            foreach($params as $par => $val) {
                $url = sprintf('%s/%s/%s',$url,$par,$val);
            }
        } else {
            $url = sprintf('%s/%s/%s',$url,'id',$req->getParam('id'));
        }
        return sprintf("<a target='Print' href='%s/format/prn'>%s</a>", $url, $this->view->translate('Print'));
    }

    public function setView(Zend_View_Interface $view)
    {
        $this->view = $view;
    }
}
?>